<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="Public/js/jquery-1.7.js"></script>
<script type="text/javascript" src="Public/js/jquery.form.js"></script>
<script type="text/javascript" src="Public/js/jspopup/popup.js"></script>
<script type="text/javascript" src="Public/js/jHtmlArea/scripts/jHtmlArea-0.7.0.js"></script>
<link rel="Stylesheet" type="text/css" href="Public/js/jHtmlArea/style/jHtmlArea.css" />
<style>
#cText tr td{
	border:1px dotted  #999;
	border-collapse:0px;
	border-spacing:0px;
	
}
</style>
<script>
$(document).ready(function(){
	$("#img_shuoming").htmlarea();
	
	$("#save").bind("click",function(){
		$('#userForm').ajaxSubmit(options); 
	});
	
	//添加行业执行的代码
	var options={
			 beforeSubmit:  showRequest,  
			 success:       showResponse,
			 dataType: 'json'
	};
	function showRequest(formData, jqForm, options) {    
		if($("#photo").val()==""){
			$("#errname").html("<img align='absmiddle' src='Public/image/err.gif' />请上传图片");
			return false;
		}else{
			$("#errname").html("<img align='absmiddle' src='Public/image/yes.gif' />");
		}
		 return true;
	}  
	function showResponse(responseText, statusText, xhr, $form)  { 
		alert(responseText);
		/*var _ok=parseInt(responseText);
		if(_ok>=1){
			pAlert("信息提示","保存成功");
			
		}else{
			pAlert("信息提示","保存失败");
			//parent.window.location.reload();
		}
		*/
	} 
});
function pAlert(title,content){
	 var pop=new Popup({ isClose:true,contentType:4,isReloadOnClose:false,width:200,height:50,isSupportDraging:false,isBackgroundCanClick:true});
   pop.setContent("title",title);
   pop.setContent("alertCon",content);
   pop.build();
   pop.show();
}
function showDialog(response){
	var _ok=parseInt(response);
	if(_ok>=1){
		pAlert("信息提示","保存成功");
		
	}else{
		pAlert("信息提示","保存失败");
		//parent.window.location.reload();
	}
}

</script>
<div>
	<form method="post" action="?m=Admin&a=saveQiangti" id="userForm" enctype="multipart/form-data" target="targetiframe">
  	<table width="100%" border="0" id="cText" cellspacing="0" cellpadding='0' class="drawers">
  		<tr>
  			<td width="10%">图片上传</td>
  			<td align="left" width="90%">
  				<input type="file" name="photo" id="photo"><span id="errname"></span>
  			</td>
  		</tr>
  		<tr>
  			<td>内容</td>
  			<td>
  			<textarea id="img_shuoming" name="data[img_shuoming_en]" cols="83" rows="10">{$imageData['text']|default=''}</textarea>
  			</td>
  		</tr>
  		<tr>
  			<td colspan="2" align="center">
  				<input type="button" value="保存" id="save" name="save" style="display:none">
  				<input type="submit" value="保存" style="display:">
  				<input type="hidden" value="2" name="data[img_bz]">
  				<input type="hidden" value="{$imageData['pid']}" name="data[pid]">
  				<input type="hidden" value="en" name="data[m_bj]">
  			</td>
  		</tr>
  	</table>
  	</form>
</div>
<div style="display:none">
<iframe id="targetiframe" name="targetiframe"></iframe>
</div>